import { Component } from "react"

// 通过高阶组件的方式，给组件增加公共的属性。

export const withRouter = function (SourceCom) {

    return class extends Component {

        

        history={
            push:function(url){
                console.log("成功跳转：",url);
            },
            go:function(){},
            back:function(){}
        }    

        render() {
            return (
                <>
                
                    <SourceCom {...this.props} history={this.history} />
                    <div>ddd</div>
                </>
            )
        }
    }
}